var t = getApp();

Page({
    data: {
        page: 1,
        btnStatus: !1
    },
    onLoad: function(t) {
        this.getData();
    },
    toDetails: function(t) {
        var a = t.currentTarget.dataset.id;
        console.log(a), wx.navigateTo({
            url: "/packageE/groupCode/groupCodeLabel/groupCodeLabel?id=" + a
        });
    },
    chooseSta: function() {
        this.setData({
            btnStatus: !this.data.btnStatus
        });
    },
    creation: function(t) {
        wx.navigateTo({
            url: "/packageE/groupCode/groupCodeCreate/groupCodeCreate"
        });
    },
    record: function(t) {
        wx.navigateTo({
            url: "/packageE/groupCode/groupCodeRecord/groupCodeRecord"
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        if (!(this.data.current_page >= this.data.last_page)) {
            var t = this.data.page + 1;
            this.setData({
                page: t
            }), this.getMore();
        }
    },
    onShareAppMessage: function() {},
    getData: function() {
        var a = this, o = t.getNetAddresss("plugin.group-code.api.group-code.ranking-list");
        t._postNetWork({
            url: o,
            data: {
                page: this.data.page
            },
            success: function(t) {
                var o = t.data;
                1 == o.result ? (console.log(o), a.setData({
                    info: o.data,
                    current_page: o.data.list.current_page,
                    last_page: o.data.list.last_page
                })) : (wx.showToast({
                    title: o.msg,
                    icon: "none"
                }), console.log(o.msg));
            }
        });
    },
    getMore: function() {
        var a = this, o = t.getNetAddresss("plugin.group-code.api.group-code.ranking-list");
        t._postNetWork({
            url: o,
            data: {
                page: a.data.page
            },
            success: function(t) {
                var o = t.data;
                1 == o.result ? (console.log(o), o.data.list.data = a.data.info.list.data.concat(o.data.list.data), 
                a.setData({
                    info: o.data,
                    current_page: o.data.list.current_page,
                    last_page: o.data.list.last_page
                })) : (wx.showToast({
                    title: o.msg,
                    icon: "none"
                }), console.log(o.msg));
            }
        });
    }
});